<template>
	<view class="">
		<view class="exchange_bg">
			<view class="jui_bg_fff jui_lrtop box jui_flex jui_flex_justify_between ">
				<view class="hb jui_flex jui_flex_justify_center  " @tap='huobi(item)' v-for="(item,index) in list" :key="index">
					<view class="">
						<view class="jui_h60"></view>
						<image :src="item.image" style="height: 124rpx;width: 124rpx;" mode=""></image>
						<view class="jui_mar_t20">
							{{item.name}}
						</view>
						<view class="jui_mar_t20 zhusecol" v-if="item.balance">
							{{item.balance}} (U)
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import vNavigation from '@/components/navigation/navigation.vue'
	export default {
		components: {
			vNavigation
		},
		data() {
			return {
				list:[],
			}
		},
		onLoad() {
			
		},
		onShow() {
			this.exchange()
			// this.getFromToken()
		},
		methods: {
			getFromToken() {
				this.$api.getFromToken({data:1}).then(res => {
					if (res.code == 1) {
						this.FromToken = res.FromToken;
						this.exchange()
					}
				});
			},
			exchange(){
				let data = {
					FromToken:this.FromToken,
				}
				this.$api.exchange_house(data).then(res => {
					this.list = res.data
				});
			},
			huobi(item) {
				uni.navigateTo({
					url: `/pages/index/exchange/chooseDealFor?id=${item.id}&image=${item.image}`
				})
				// if (item==1) {
				// 	uni.navigateTo({
				// 		url: '/pages/index/exchange/chooseDealFor'
				// 	})
				// } else {
				// 	this.$msg('暂未开放');
				// }

			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF;
	}
	.zhusecol {
		color: $zhuse;
	}
	.exchange_bg {
		background: $zhuse;
		// padding-top: 90rpx;
		.box {
			padding: 70rpx 30rpx 0 30rpx;
			flex-wrap: wrap;
		}
	}

	.topPlace {
		width: 100%;
		height: var(--status-bar-height);
		background: $zhuse;

	}

	.hb {
		width: 322rpx;
		height: 322rpx;
		background: #FFFFFF;
		box-shadow: 0px 0px 10rpx 0rpx rgba(0, 0, 0, 0.1);
		border-radius: 32rpx;
		text-align: center;
		margin-bottom: 30rpx;
	}
</style>
